<?php 

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG', true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);

defined('YII_PATH') or define(
	'YII_PATH',
	dirname(dirname(__FILE__))
	.DIRECTORY_SEPARATOR.'include'
	.DIRECTORY_SEPARATOR.'framework'
);

$config = array(
	// main config
	'app'	=> array(
		'basePath'		=> '___path.root.server___',
		'name'			=> '___view.name___',
		'language'		=> '___lang.current___',
		'sourceLanguage'=> 'ru',
		'preload'		=> array(
			'log',
		),
		'import'		=> array(
			// стандартные компоненты
			'application.plugins.yii.include.components.*',
			// стандартные модели
			'application.plugins.yii.include.models.*',
			// консольные комманды
			'application.plugins.yii.include.commands.*',
			// расширения
			'application.plugins.yii.include.extensions.*',
			// помошники
			'application.plugins.yii.include.helpers.*',
			// jtemplates
			'application.plugins.yii.include.extensions.jtemplates.*',
			// kohana image
			'application.plugins.yii.include.extensions.image.helpers.*',
			'application.plugins.yii.include.extensions.image.*',
			'application.plugins.yii.include.extensions.image.drivers.*',
		),
		'behaviors'		=> array(
			'lstpl'	=> array(
				'class'	=> 'application.plugins.yii.include.components.LsTemplateBehavior',
			),
		),
		'modules'		=> array(
		),
		'components'	=> array(
			'db'	=> array(
				'class'				=> 'system.db.CDbConnection',
				'connectionString'	=> 'mysql:host=___db.params.host___;dbname=___db.params.dbname___;port=___db.params.port___',
				'emulatePrepare'	=> true,
				'username'			=> '___db.params.user___',
				'password'			=> '___db.params.pass___',
				'charset'			=> 'utf8',
				'enableParamLogging'=> true,
				'tablePrefix'		=> '___db.table.prefix___',
			),
			'log'	=> array(
				'class'		=> 'CLogRouter',
				'routes'	=> array(),
			),
			'assetManager'	=> array(
				'class'				=> 'system.web.CAssetManager',
				'basePath'			=> '___path.root.server___/templates/cache',
				'baseUrl'			=> '___path.root.web___/templates/cache',
			),
			'user'	=> array(
				'class'				=> 'application.plugins.yii.include.components.LsWebUser',
				'loginUrl'			=> array('/login'),	// ?? а отработает ли ? и надо оно тут ?
			),
			'urlManager'	=> array(
				'class'				=> 'system.web.CUrlManager',
				'urlFormat'			=> 'path',
				'showScriptName'	=> false,
				'appendParams'		=> false,
				'rules'				=> array(),
			),
			'clientScript'	=> array(
				'class'				=> 'application.plugins.yii.include.components.LsClientScript',
				'packages'			=> array(
					'960gs.fluid'	=> array(
						'basePath'	=> 'application.plugins.yii.templates.packages.960gs_fluid',
						'css'		=> array('css/grid.css','css/ie6.css','css/ie.css'),
						'js'		=> array('js/ie.js'),
						'depends'	=> array('jquery'),
					),
				),
			),
			'coreMessages'	=> array(
				'class'				=> 'application.plugins.yii.include.components.LsPhpMessageSource',
				'language'			=> '___lang.current___',
				'forceTranslation'	=> true,
				'basePath'			=> YII_PATH.DIRECTORY_SEPARATOR.'messages',
			),
			'messages'	=> array(
				'class'				=> 'application.plugins.yii.include.components.LsPhpMessageSource',
				'language'			=> '___lang.current___',
				'forceTranslation'	=> true,
			),
			'cache'=>array(
				'class'				=> 'application.plugins.yii.include.components.LsCache',
				'keyPrefix'			=> '___sys.cache.prefix___._yii_',
			),
		),
	),
	
	// web app config (merge with 'app')
	'webApp'	=> array(
		'homeUrl'			=> '___path.root.web___',
		'layout'			=> 'column2side',
		'defaultController'	=> '_lsyii',
		'controllerMap'		=> array(
			'_lsyii'	=> array(
				'class'	=> 'application.plugins.yii.include.components.LsyiiController',
			),
		),
	),
	
	// console app config (merge with 'app')
	'consoleApp'	=> array(
		'commandPath' => '___path.root.server___/plugins/yii/include/framework/cli/commands/shell',
		'commandMap' => array(
			'lsshell' => array(
				'class' => 'application.plugins.yii.include.commands.LsshellCommand',
			),
		),
	),
	
	
	// AR -> Entity map
	'modelEntityMap' => array(
		'Blog'			=> 'Blog',
		'BlogUser'		=> 'Blog_BlogUser',
		'City'			=> 'User_City',
		'Comment'		=> 'Comment',
		'CommentOnline'	=> 'Comment_CommentOnline',
		'Country'		=> 'User_Country',
		'Favourite'		=> 'Favourite',
		'Friend'		=> 'User_Friend',
		'Invite'		=> 'User_Invite',
		'NotifyTask'	=> 'Notify_Task',
		'Page'			=> 'PluginPage_Page',
		'Reminder'		=> 'User_Reminder',
		'Session'		=> 'User_Session',
		'Talk'			=> 'Talk',
		'TalkUser'		=> 'Talk_TalkUser',
		'Topic'			=> 'Topic',
		'TopicRead'		=> 'Topic_TopicRead',
		'TopicTag'		=> 'Topic_TopicTag',
		'User'			=> 'User',
		'Vote'			=> 'Vote',
		'XtextFile'		=> 'PluginXtext_File',
	),
);

if(YII_DEBUG){
	$config['webApp']['components']['log']['routes']['weblog'] = array(
		'class'			=> 'CWebLogRoute',
		'levels'		=> 'trace, warning, error, info',
		'categories'	=> 'system.*, application.*',
		'showInFireBug'	=> true,
	);
}

Config::Set('router.page._lsyii', 'PluginYii_ActionYiiController');

return $config;

?>